<?php
/* @var $this ReceiptController */
/* @var $model Receipt */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'receipt-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
	<?php echo $form->labelEx($model,'receipt_date'); ?>
                <?php 
   $form->widget('zii.widgets.jui.CJuiDatePicker', array(
        'model'=>$model,
        'attribute'=>'receipt_date',
        'name'=>$model->receipt_date, 
        'value'=>$model->receipt_date,
        'options'=>array('dateFormat'=>'yy-mm-dd', 
                        'altFormat'=>'dd-mm-yy', 
                                                'showAnim'=>'fold',
                        'changeMonth'=>'true', 
                        'changeYear'=>'true', 
                        'yearRange'=>'1995:2015', 
                        'showOn'=>'both',
                        'buttonText'=>'...'),
        'htmlOptions'=>array('size'=>'10')
   ));
  ?>
                <?php echo $form->error($model,'receipt_date'); ?>
        </div>

	<div class="row">
		<?php echo $form->labelEx($model,'payment_total'); ?>
		<?php echo $form->textField($model,'payment_total',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'payment_total'); ?>
	</div>

	<div class="row">
			<?php echo $form->labelEx($model,'orderheader_id'); ?>
		<?php echo $form->dropDownList ($model, 'orderheader_id', CHtml::listData(
                Orderheader::model()->findAll(), 'id','id'),
                        array('prompt' => 'Select an orderheader')
                        ); ?>
                <?php echo $form->error($model,'orderheader_id'); ?>
        </div>

	<div class="row">
		<?php echo $form->labelEx($model,'payment_type'); ?>
		<div class="row">
                <?php echo $form->dropDownList($model, 'payment_type',$htmlOptions=array
                (
                'credit card' =>'credit card',
                'cash' =>'cash',
                'discount' => 'discount'
                ),array('prompt' => 'Select a payment type')) ?>
                <?php echo $form->error($model,'payment_type'); ?>
        </div>

		<?php echo $form->error($model,'payment_type'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->